package supremeragcalc.util.gui;

import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class RightArrowButton extends JLabel implements MouseListener, SkinConstants {
	private static final long serialVersionUID = 811320065073801618L;

	ImageIcon icon;
	private String BT_STAND		= PATHSKIN + "arw_right.bmp";
	private String BT_PRESSED	= PATHSKIN + "arw_right_on.bmp";


	public RightArrowButton() {
		this.addMouseListener(this);

		GenericImage imgSource = new GenericImage(BT_STAND);
		changeIcon(imgSource.getImage());
	}


	public void changeIcon(Image img) {
		ImageIcon icon = new ImageIcon(img);
		this.setIcon(icon);

		int w = img.getWidth(null);
		int h = img.getHeight(null);
		this.setSize(w, h);

	}

	//Mouse methods Implemented
	public void mouseClicked(MouseEvent e) {}

	public void mouseEntered(MouseEvent e) {}

	public void mouseExited(MouseEvent e) {}

	public void mousePressed(MouseEvent e) {
		GenericImage imgSource = new GenericImage(BT_PRESSED);
		changeIcon(imgSource.getImage());
	}

	public void mouseReleased(MouseEvent e) {
		GenericImage imgSource = new GenericImage(BT_STAND);
		changeIcon(imgSource.getImage());
	}
}
